<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>押金管理</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/metro/easyui.css"/>
<link rel="stylesheet" href="static/easyui/themes/icon.css"/>
</head>
<body>
	<script type="text/javascript">
	 var healthproject = function(value,row,index){
		var projectname="";
		$.ajax({
			url:'init-feelisttwo',
			type:'post',
			data:{'hospid':row.hosp_id},
			async:false,//是否异步刷新
			success:function(data){
				if(typeof(data[0]['project_name'])=="undefined"){
					return "暂无项目";
				}else{
					for (var i = 0; i < data.length; i++){
		                projectname+="<a>"+data[i]['project_name']+" </a>"+"</br>";
					}
				}
				
			}
		});
		return projectname;
	}
	
	
	var healthprice = function(value,row,index){
		if(row.project_price==null){
		   $("#health").text("0");
		}
		var projectprice="";
		$.ajax({
			url:'init-feelisttwo',
			type:'post',
			data:{'hospid':row.hosp_id},
			async:false,//是否异步刷新
			success:function(data){
				if(typeof(data[0]['project_price'])=="undefined"){
					return "暂无项目";
				}else{
					var totalm=0;
					for (var i = 0; i < data.length; i++){
	                	projectprice+="<a>"+data[i]['project_price']+" </a>"+"</br>";                	  
	                    totalm = totalm +data[i]['project_price'];
					}
					 $("#health").text(totalm);
				}
				
			}
		});
		return projectprice;
	}
		
	
	    //体检结果
		var healthresult = function(value,row,index){
		var healthr="";
		var str = "";
		var str1 = "";
		var opin = true;
		var notnull = true;
		var opin2 = true;
		var afterreturn=true;
		$.ajax({
			url:'init-feelisttwo',
			type:'post',
			data:{'hospid':row.hosp_id},
			async:false,//是否异步刷新
			success:function(data){
				if(data.length==0){
					return "";
				}
				 if(typeof(data[0]['health_result'])!="undefined" && typeof(data[0]['project_name'])!="undefined"){
					for (var i = 0; i < data.length; i++){
		                healthr+="<a>"+data[i]['health_result']+" </a>"+"</br>";  
					}
					opin=false;
				 }else if(typeof(data[0]['project_name'])!="undefined" &&  typeof(data[0]['health_result'])=="undefined"){
					 if(data[0]['health_money_status']==1){
						 afterreturn = false;
					 }  
					opin2=false;
				 }else if(typeof(data[0]['project_name'])=="undefined" &&  typeof(data[0]['health_result'])=="undefined"){
					   notnull = false;
				 }
			}
		});
		
		if(opin==false){
			return healthr;
		}else if(opin2==false){
			if(afterreturn==false){
				$("#health").text("0");
				str1 +='<span style="color:red;">已退费</span>';
				return str1;
			}
            str += '<span><a href="#" class="easyui-linkbutton" onclick="returnfeehealth(\'' + row.hosp_id +'\',\'' + row.clinic_name +'\',\'' + row.clinic_id +'\')">退费</a></span>';
            return str;
		}else if(notnull == false){
			return "";
		}
		
	} 
	
	    
	    
	    //调整床位前的床位租金
	    var changebedmoney = function(value,row,index){
	    	console.log(row.hosp_id);
			var changemoney="";
			$.ajax({
				url:'find-changebedrecord',
				type:'post',
				data:{'hospid':row.hosp_id},
				async:false,//是否异步刷新
				success:function(data){
					if(typeof(row.bed_money)=="undefined"){
						$("#bedinputid").text("0");
					}else{
						if(data.length==0){
							var d = row.days+1;
							var m = row.bed_money;
							var sub = parseInt(m)*parseInt(d);
	   						$("#bedinputid").text(sub);
						}else{
							var oldbmoney = 0;
							for (var i = 0; i < data.length; i++){
								changemoney+="<a>"+data[i]['oldbedmoney']+" </a>"+"</br>";
								oldbmoney = oldbmoney +data[i]['oldbedmoney'];
							}
						    var newday = row.changedays;//调整的天数
							var newmoney = row.bed_money;//调整后的租金
							var sub2 = (parseInt(newmoney)*parseInt(newday)+parseInt(oldbmoney));
							$("#bedinputid").text(sub2); 
						}
						
					}
				}
			});
			return changemoney;
		}
	    
		$(function(){
			//交押金的记录
			$('#cashmoney-dg').datagrid({
			    url:'init-ReturnMoney',
			    pagination:true,
      		    pageNumber:1,
      		    pageSize:10,
      		    pageList:[10,20,30,40],
			    columns:[[
					{field:'hosp_id',title:'住院号',width:80},
					{field:'clinic_name',title:'姓名',width:80},
					{field:'clinic_sex',title:'性别',width:50},
					{field:'returnmoney_money',title:'金额',width:70,
						styler: function(value,row,index){
	   						 if(row.returnmoney_state==1){
									return 'color:blue;';
	   						 }else if(row.returnmoney_state==0){
	   							    return 'color:orange;';
	   						 }else if(row.returnmoney_state==-1){
  							        return 'color:red;';
  						     }
						 }
					
					},
					{field:'returnmoney_time',formatter:comFormatDate,title:'交易时间',width:130},
					{field:'returnmoney_state',title:'类型',width:100,
						formatter:function(value,row,index){
							if(row.returnmoney_state==-1){
								 return "退费记录";
							}else if(row.returnmoney_state==0){
								 return "总押金记录";
							}else if(row.returnmoney_state==1){
								 return "催缴押金记录";
							}else if(row.returnmoney_state==2){
								 return "结算记录";
							}
	   						
	   					 },
	   					 styler: function(value,row,index){
	   						 if(row.returnmoney_state==1){
									return 'color:blue;';
	   						 }else if(row.returnmoney_state==0){
	   							    return 'color:orange;';
	   						 }else if(row.returnmoney_state==-1){
   							        return 'color:red;';
   						     }
						 }
					}
			    ]]
			});
			
			
			//所搜住院号查询之前的床位号[费用结算]
			$("#hospid_sercher").searchbox({
				searcher:function(value,name){
					$("#hospid-record-win").window("open");
				}

			});
			
			//双击获取住院号[费用结算]
			$("#hosprecord-dg").datagrid({
				onDblClickRow: function(rowIndex,rowData){
					//住院号
                    $("#hospid_sercher").textbox('setValue',rowData.hosp_id);
                    //病人姓名
                    $("#name_input").textbox('setValue',rowData.clinic_name);
                    $("#returncashmoneyid").textbox('setValue',rowData.cash_dmoney);
                    //押金余额
                    $("#cashmoney").textbox('setValue',rowData.cash_dmoney);
                    //总消费金额
                    $("#fee").textbox('setValue',rowData.feemoney);

                    $("#hospid-record-win").window("close");
				}
				
			});
			
			//结算的确定按钮
			$("#add-fee-inform").click(function(){
				$('#fee-for').form({
				    url:'add-feemoney',
				    onSubmit: function(){	
				    },
				    success:function(data){
				    	$('#fee-for').form("clear");//清空文本
				    	$("#subyajin-tab").datagrid('reload');
				    	$.messager.show({
                            title:'提示信息' , 
                            msg:'结算成功!'
                        });
				    }
				}).submit();
			});
			
			//交易记录的窗口
			$("#login-cashmoney-record").click(function(){
				$("#cashmoney-record-win").window("open");
			});
			
			
			//住院表的信息
			$("#hosprecord-dg").datagrid({
			    url:'init-hospretruemoney',
			    pagination:true,
      		    pageNumber:1,
      		    pageSize:10,
      		    pageList:[10,15],
			    columns:[[
			    	{field:'hosp_id',title:'住院号',width:100},
					{field:'clinic_name',title:'病人姓名',width:100},
					{field:'clinic_sex',title:'性别',width:100},
					{field:'cash_dmoney',title:'押金余额',width:100,
						styler: function(value,row,index){
							if(value==0){
								return 'color:blue;';
							}
						}
					
					},
					{field:'bed_no',title:'床位号',width:100},
					{field:'feemoney',title:'消费总金额',width:100},
					{field:'hosp_time',formatter:comFormatDate,title:'登记时间',width:180}
			    ]]
			});
			
			
			//住院表的信息
			$("#sickuserrecord-tg").datagrid({
			    url:'reg-hosprecord',
			    pagination:true,
      		    pageNumber:1,
      		    pageSize:10,
      		    pageList:[10,15],
			    columns:[[
			    	{field:'hosp_id',title:'住院号',width:70},
					{field:'clinic_name',title:'病人姓名',width:70},
					{field:'clinic_sex',title:'性别',width:40},
					{field:'cash_totalmoney',title:'总押金',width:50,hidden:true},
					{field:'cash_dmoney',title:'余额',width:50}
			    ]]
			});
					
			 //双击获取住院号
			$("#sickuserrecord-tg").datagrid({
				onDblClickRow: function(rowIndex,rowData){
					var hospid = rowData.hosp_id;
					$("#totalmoneyid").text(rowData.cash_totalmoney);
					//费用清单的信息
					$("#free-cashmoney-dg").datagrid({
					    url:'init-feelist?hospid='+hospid,	
					    onLoadSuccess: function (data) { 
					    	var rows = $("#free-cashmoney-dg").datagrid("getRows");
							var roww = rows.length;
					    	var totalm = 0;
							for (var i = 0; i < rows.length; i++) {
								 totalm = totalm + parseInt(rows[i].ill_hz)*parseInt(rows[i].drug_purchase_price);
		  						 $("#drug").text(totalm);
							 }
						
							if(data==null||data.total ==0){
								$("#bedinputid").text("0");
								$("#drug").text("0");
								$("#health").text("0");
								$(this).datagrid('appendRow',{
									        docdetails_id:'<div style="height:30px;font-size:18px;line-height:30px;text-align:center;color:red">没有相关记录！</div>',
											rownumbers : false
											
									//合并单元格
								}).datagrid('mergeCells',{
											index : 0,
											field : 'docdetails_id',
											colspan : 11
								});
								//隐藏分页导航条
								$(this).closest('div.datagrid-wrap').find('div.datagrid-pager').hide();
							}else{
								$(this).closest('div.datagrid-wrap').find('div.datagrid-pager').show();
							}

							var start = 0;
							var end = 0;
							var mer = ['clinic_name','bed_money','days','project_name','project_price','health_result','feeops'];//需要合并的字段，即field
							//有数据就合并----对应数据的数量
							if (data.total > 0){
							    var temp = data.rows[0].clinic_name;   //需要比较的列-----排班类型----门诊还是住院
							    for (var i = 1; i < data.rows.length; i++) {
								    //第一列的门诊或住院类型=遍历过程中的门诊或住院
									if (temp == data.rows[i].clinic_name) {
									     end++;
									} else {
									    if (end> start) {
											for(var j = 0; j < mer.length; j ++){
												$("#free-cashmoney-dg").datagrid('mergeCells', {
													index: start,//起始索引
													rowspan: end - start + 1,  //需要合并的行数
													field: mer[j]
												});
											}
									   }
									    temp = data.rows[i].clinic_name;
									    start = i;
									    end = i;
								 }
							 }
							    //这里是为了判断重复内容出现在最后的情况
							    if (end > start) {
									for(var j = 0; j < mer.length; j ++){
										$("#free-cashmoney-dg").datagrid('mergeCells', {
											index: start,
											rowspan: end - start + 1,
											field: mer[j]
										});
									}
							    }
							}/* 最大if结束 */
						}, 
		      		    columns:[[
		      		    	{field:'docdetails_id',title:'编号',width:50},
		      		    	{field:'clinic_id',title:'编号',width:60,hidden:true},
		      		    	{field:'hosp_id',title:'住院号',width:60,hidden:true},
							{field:'clinic_name',title:'姓名',width:65},
							{field:'drug_name',title:'药品名称',width:98},
							{field:'ill_hz',title:'用药数量',width:60},
							{field:'drug_purchase_price',title:'药品单价',width:60,
								formatter:function(value,row,index){
									if(row.drug_purchase_price==null){
										$("#drug").text("0");
									}
			   						 return value;
			   					   }
							},
							{field:'days',title:'住院天数',width:60,
								formatter:function(value,row,index){
			   						 return value+1+"天";
			   					   }
							},
							{field:'bedchange_people',title:'调整人',width:60,hidden:true},
							{field:'changedays',title:'调整天数',width:60,hidden:true},
							{field:'bed_money',title:'床位租金',width:60,
								formatter:function(value,row,index){
									if(row.bed_money==null){
										$("#bedinputid").text("0");
										return "空床";
									}else{
										if(row.days==0){
											 var d = row.days+1;
											 var m = row.bed_money;
					   						 $("#bedinputid").text(m);
										}else if(row.days != 0){
											var d = row.days+1;
											var m = row.bed_money;
											var sub = parseInt(m)*parseInt(d);
					   						$("#bedinputid").text(sub);
										}
									}
									if(row.bedchange_people==null){
										return value+"元";
									}else{
										 return '</br>'+value+"元"+
											'</br></br><a href="#" class="easyui-linkbutton" onclick="lookchangebed(\'' + row.hosp_id +'\')"><span style="color:red;">调整记录</span></a></br></br>';
					   					
									}		
			   						
								}
							},
							{field:'oldbedmoney',title:'调整前的租金',width:95,hidden:true,
								formatter:changebedmoney
							},
							{field:'project_name',title:'体检项目',width:95,
								formatter:healthproject	
							},
						    {field:'project_price',title:'项目金额',width:60,
								formatter:healthprice	
							},
						    {field:'health_result',title:'体检结果',width:60,
								formatter:healthresult	
							},
							{field:'operationtype_name',title:'手术项目',width:110},
							{field:'oparrange_money',title:'预估金额',width:110,hidden:true},
							{field:'op_record_money',title:'手术金额',width:60,
								formatter:function(value,row,index){
									if(row.operationtype_name==null){
										$("#ops_input_id").text("0");
									}else{
										if(row.op_record_money==null){
											var opm1= row.oparrange_money;
					   						 $("#ops_input_id").text(opm1);
											return row.oparrange_money;
											
										}else{
											 var opm= row.op_record_money;
					   						 $("#ops_input_id").text(opm);
											return row.op_record_money;
										} 
										 
										 
									}
									 
			   					 }
							}
					    ]]
						
					});
					
				}	
			}); 
		
			$("#free-cashmoney-dg").datagrid({
			   // url:'init-feelist?hospid='+hospid,
      		    columns:[[
      		    	{field:'docdetails_id',title:'编号',width:50},
      		    	{field:'clinic_id',title:'编号',width:60,hidden:true},
					{field:'clinic_name',title:'姓名',width:65},
					{field:'drug_name',title:'药品名称',width:98},
					{field:'ill_hz',title:'用药数量',width:60},
					{field:'drug_purchase_price',title:'药品单价',width:60},
					{field:'days',title:'住院天数',width:60},
					{field:'bed_money',title:'床位租金',width:60},
					{field:'project_name',title:'体检项目',width:95},
					{field:'project_price',title:'项目金额',width:60},
					{field:'health_result',title:'项目金额',width:60},
					{field:'operationtype_name',title:'手术项目',width:110},
					{field:'op_record_money',title:'手术金额',width:60}	
			    ]]	
			});
			
			
			
			//所搜住院号查询之前的床位号
			$("#hospidthree_sercher").searchbox({
				searcher:function(value,name){
					$("#hospid-record-win3").window("open");
				}

			});
			
			//双击获取住院号
			$("#hosprecord-dg3").datagrid({
				onDblClickRow: function(rowIndex,rowData){
					//住院号
                    $("#hospidthree_sercher").textbox('setValue',rowData.hosp_id);
                    //病人姓名
                    $("#namethree_input").textbox('setValue',rowData.clinic_name);
                    //押金余额
                    $("#rcashmoney").textbox('setValue',rowData.cash_dmoney);

                    $("#hospid-record-win3").window("close");
				}
				
			}); 
			
			//交金额的确定按钮
			$("#addoutmoney").click(function(){
				$("#subfee-for").form({
				    url:'add-returnoutfeemoney',
				    onSubmit: function(){
				    },
				    success:function(data){
				    	$('#subfee-for').form("clear");//清空文本
				    	$("#subyajin-tab").datagrid('reload');
				    	$.messager.show({
                            title:'提示信息' , 
                            msg:'交费成功!'
                        });
				    }
				}).submit();
			});
			
			
			//住院表的信息（欠费）
			$("#hosprecord-dg3").datagrid({
			    url:'init-outhosprecord',
			    pagination:true,
      		    pageNumber:1,
      		    pageSize:10,
      		    pageList:[10,15],
      		    columns:[[
	      		    {field:'hosp_id',title:'住院号',width:80},
					{field:'clinic_name',title:'病人姓名',width:90},
					{field:'clinic_sex',title:'性别',width:60},
					{field:'clinic_age',title:'年龄',width:60},
					{field:'user_name',title:'主治医生',width:90},
					{field:'section_name',title:'科室',width:70},
					{field:'cash_dmoney',title:'押金余额',width:80,
						styler: function(value,row,index){
							if(value<0){
								return 'color:red;';
							}
						}
					},
					{field:'cash_totalmoney',title:'总金额',width:90}
			    ]]
			});
			
			//催缴押金的窗口
			$("#pay-money").click(function(){
				//获取住院号
				var hosp_rows =$("#subyajin-tab").datagrid('getSelected');
				//赋值给住院号
				$("#hospid").textbox('setValue',hosp_rows.hosp_id);
				$("#pay-money-win").window("open");
			});
			
			//催缴押金的确定按钮
			$("#paymoney-confrim").click(function(){
				$("#paymoney-for").form({
					url:'add-paymoney',
					onSubmit: function(){
				    },
				    success:function(data){
				    	$("#paymoney-for").form("clear");//清空文本
				    	$("#pay-money-win").window('close');
				    	$("#subyajin-tab").datagrid('reload');

				    }
				}).submit();
			});

			//催缴押金的住院信息
			$("#subyajin-tab").datagrid({
			    url:'reg-hosprecord',
			    pagination:true,
      		    pageNumber:1,
      		    pageSize:5,
      		    pageList:[5,10,15],
			    columns:[[
			    	{field:'hosp_id',title:'住院号',width:100},
					{field:'clinic_name',title:'病人姓名',width:100},
					{field:'clinic_sex',title:'性别',width:100},
					{field:'cash_dmoney',title:'押金余额',width:100,
						styler: function(value,row,index){
							if(value<-150){
								return 'color:red;';
							}else if(value==0){
								return 'color:blue;';
							}
						}
					
					},
					{field:'bed_no',title:'床位号',width:116}
			    ]]
			});
			
			
			//体检项目退费的确定按钮
			$("#returnfee-confrim").click(function(){
				$("#reutrnhealthmoney-from").form({
					url:'returns-healmoney',
					onSubmit: function(){
				    },
				    success:function(data){
				    	$("#reutrnhealthmoney-from").form("clear");//清空文本
				    	$("#healthfee-win").window('close');
				    	$("#free-cashmoney-dg").datagrid('reload');
				    	$("#sickuserrecord-tg").datagrid('reload');
				    }
				}).submit();
			});
			
			
			
			$("#cashmoney-cname").searchbox({
				searcher:function(value,name){
				    $('#subyajin-tab').datagrid({
					    url:'reg-hosprecord',
					    queryParams:{
					    	clinicname:value,
					    },
					    method:"Post",
					    pagination:true,
		      		    pageNumber:1,
		      		    pageSize:5,
		      		    pageList:[5,10,15],
					    columns:[[
					    	{field:'hosp_id',title:'住院号',width:100},
							{field:'clinic_name',title:'病人姓名',width:100},
							{field:'clinic_sex',title:'性别',width:100},
							{field:'cash_dmoney',title:'押金余额',width:100,
								styler: function(value,row,index){
									if(value<-150){
										return 'color:red;';
									}
								}
							
							},
							{field:'bed_no',title:'床位号',width:116}
					    ]]
					});
				}
        	
        	});
			
		});
		
		//体检未体检就进行退费
		function returnfeehealth(hosp_id,clinic_name,clinic_id){
			//住院号
            $("#reutrnhospid").textbox('setValue',hosp_id);
            //病人姓名
            $("#returnname").textbox('setValue',clinic_name);
            //押金余额
            var healmoney = $("#health").text();
            $("#retrunhealmoney").textbox('setValue',healmoney);
            $("#cilicnid").textbox('setValue',clinic_id);

			$("#healthfee-win").window('open');
		}
		
		
		//查看调整床位的记录
		function lookchangebed(hosp_id){
			$("#feerchangebed-win").window("open");
			//调整床位的信息记录
			$("#feerchangebed-table").datagrid({
			    url:'find-changebedrecord',
			    queryParams:{
			    	hospid:hosp_id
			    },
			    columns:[[
			    	{field:'hosp_id',title:'住院号',width:70},
					{field:'clinic_name',title:'病人姓名',width:70},
					{field:'clinic_sex',title:'性别',width:50},
					{field:'bed_no',title:'旧床位号',width:80},
					{field:'changedays',title:'调整天数',width:63,
						formatter:function(value,row,index){
							return value+"天";
						}
					},
					{field:'oldbedmoney',title:'租金',width:50},
					{field:'bed_state',title:'状态',width:50,
						formatter:function(value,row,index){
							if(value==2){
								return "空床";
							}
						}
					},
					{field:'bedchange_time',formatter:comFormatDate,title:'调整时间',width:140},
					{field:'bedchange_people',title:'经办人',width:60}
					
			    ]]
			});
		}
		
		/**
		 * 时间格式YYY-mm-dd hh:mm:ss
		 */
		function comFormatDate(date) {
			var day = new Date(date); 
			var Year = 0; 
			var Month = 0; 
			var Day = 0; 
			var CurrentDate = ""; 
			//初始化时间 
			Year= day.getFullYear();
			Month= day.getMonth()+1; 
			Day = day.getDate(); 
			Hour = day.getHours(); 
			 Minute = day.getMinutes(); 
			 Second = day.getSeconds(); 
			CurrentDate += Year + "-"; 
			if (Month >= 10 ) { 
				CurrentDate += Month + "-"; 
			}else { 
				CurrentDate += "0" + Month + "-"; 
			} 
			if (Day >= 10 ) { 
				CurrentDate += Day ; 
			}else { 
				CurrentDate += "0" + Day ; 
			} 
			if(Hour>=10){
				CurrentDate +=" "+Hour;
			}else{
				CurrentDate +=" "+"0"+Hour;
			}
			if(Minute>=10){
				CurrentDate +=":"+Minute;
			}else{
				CurrentDate +=":"+"0"+Minute;
			}
			if(Second>=10){
				CurrentDate +=":"+Second;
			}else{
				CurrentDate +=":"+"0"+Second;
			}
			return CurrentDate; 
		}
	</script>
	<div id="tt" class="easyui-tabs">
	    <div title="费用结算" data-options="closable:false" style="overflow:auto;padding:20px;display:none;">
			<!--  费用结算-->
			<fieldset style="border:1px solid #A6A6A6;border-radius:6px;width:480px;height:300px;margin-left:25px;margin-bottom: 25px;float:left;">
				<legend>费用结算</legend>
				<form method="Post" id="fee-for">
				  <p>
						<a style="margin-left: 30px;">
						<input id="hospid_sercher" name="hospId" class="easyui-searchbox" data-options="label:'住院号',height:30" style="width:200px">
						</a> 
			    		<a style="margin-left: 30px;">
			    		<input id="name_input" class="easyui-textbox" data-options="label:'病人姓名',height:30" style="width:200px">
			    		</a>
			    		
					</p>
					<p style="margin-top: 30px;">	
					   <a style="margin-left: 30px;">
						<input id="cashmoney" class="easyui-textbox" data-options="label:'押金余额',height:30" style="width:200px">
						</a>			
						<a style="margin-left: 30px;">
						<input id="fee" name="returnmoneyMoney" class="easyui-textbox" data-options="label:'总费用',height:30" style="width:200px">
						</a>
						
					</p>
					<p style="margin-top: 30px;">
					    <a style="margin-left: 30px;">
							<input id="returncashmoneyid" name="returnmoneyMoney" class="easyui-textbox" data-options="label:'退费金额',height:30" style="width:200px;color:red;">
						</a>	
					   <a style="margin-left: 30px;">
						<input value="${user.userName}"  class="easyui-textbox"  data-options="label:'经办人',height:30" style="width:200px">
						</a>
						
					</p>
					<p style="margin-top:40px;">
					    <a style="width:100px;margin-left: 30px;height:30px;border-radius:6px;" id="add-fee-inform" class="easyui-linkbutton" iconCls="icon-ok">结算</a>
						<a style="width:100px;margin-left: 50px;height:30px;border-radius:6px;" id="" class="easyui-linkbutton" iconCls="icon-no">清空</a>
						<a style="margin-left: 70px;height:30px;border-radius:6px;" id="login-cashmoney-record" class="easyui-linkbutton" iconCls="icon-check">查看交易记录</a>
					</p>
				</form>
			</fieldset>
			
			<!--  押金催缴-->
			<fieldset style="border:1px solid #A6A6A6;border-radius:6px;margin-left:15px;width:520px;height:300px;margin-bottom: 25px;float:left;">
				<legend>押金低于150进行催缴</legend>
				  <p>
				  	<a>输入姓名查询：<input id="cashmoney-cname"  class="easyui-searchbox" style="width:140px;height:30px;"></a>
				  	<a id="pay-money" class="easyui-linkbutton" iconCls="icon-add" style="width:120px;margin-left:170px;height:30px;border-radius:6px;">催缴押金</a>
				   </p>
					<table id="subyajin-tab" style="height:220px;" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:true">
					</table>
			</fieldset>	
			
			
			<!-- 折叠面板（用于欠费结算） -->
			<div style="width:1065px;margin: 0px auto;">
				<div id="p" class="easyui-panel" title="欠费结算"
				    style="width:1065px;margin: 0px auto; height:150px;background:#fafafa;"
				    data-options="closable:false,collapsible:true,minimizable:false,maximizable:false">
				    <form method="Post" id="subfee-for">
					  <p style="margin-top: 20px;">
							<a style="margin-left: 50px;">
							<input id="hospidthree_sercher" name="hospId" class="easyui-searchbox" data-options="label:'住院号',height:30" style="width:200px">
							</a> 
				    		<a style="margin-left: 20px;">
				    		<input id="namethree_input" class="easyui-textbox" data-options="label:'病人姓名',height:30" style="width:200px">
				    		</a>
				    		<a style="margin-left: 20px;">
							<input id="rcashmoney" name="returnmoneyMoney" class="easyui-textbox" data-options="label:'欠费金额',height:30" style="width:200px">
							</a>
							<a style="margin-left: 20px;">
							<input value="${user.userName}"  class="easyui-textbox"  data-options="label:'经办人',height:30" style="width:200px">
							</a>
							<a style="margin-left: 20px;width:100px;height:30px;border-radius:6px;" id="addoutmoney" class="easyui-linkbutton" iconCls="icon-ok">结算</a>
						</p>
					</form>
				</div>
			</div>
	    </div>
	    <div title="费用清单" data-options="closable:false" style="display:none;">
			<fieldset style="border:1px solid #A6A6A6;margin-top:20px;border-radius:6px;height:520px;width:234px;float:left;">
				<legend>病人信息</legend>
				<table id="sickuserrecord-tg" class="easyui-datagrid" style="height:450px;"data-options="toolbar:'#logininform-tb',fitColumns:false,singleSelect:true">
				</table>
			</fieldset>
			<fieldset style="border:1px solid #A6A6A6;border-radius:6px;margin-top:20px;width:840px;height:520px;float:left;">
				<legend>药物费用</legend>
				<p>
					 <span>
					    <span style="margin-right:7px;">总押金:</span>
			             <a id="totalmoneyid" style="border-bottom:1px solid #bbb;display: inline-block;width:80px;text-align:center;color:red;font-size:20px;"></a>
					 </span>
	                 <span>
					    <span style="margin-right:7px;margin-left: 20px;">药物费用：￥</span>
			            <a id="drug" style="border-bottom:1px solid #bbb;display: inline-block;width:50px;text-align:center;color:red;font-size:17px;"></a>
					 </span>
					 <span>
				        <span style="margin-right:7px;margin-left: 20px;">床位总租金：￥</span>
		            	<a id="bedinputid" style="border-bottom:1px solid #bbb;display: inline-block;width:50px;text-align:center;color:red;font-size:17px;"></a>
				 	</span>
					<span>
				        <span style="margin-right:7px;margin-left: 20px;">体检费用：￥</span>
		            	<a id="health" style="border-bottom:1px solid #bbb;display: inline-block;width:50px;text-align:center;color:red;font-size:17px;"></a>
				 	</span>
				 	<span>
				        <span style="margin-right:7px;margin-left: 20px;">手术费用：￥</span>
		            	<a id="ops_input_id" style="border-bottom:1px solid #bbb;display: inline-block;width:50px;text-align:center;color:red;font-size:17px;"></a>
				 	</span>
				 	
				</p>
				<table id="free-cashmoney-dg" style="height:430px;" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:true">
				</table>
			</fieldset>
	    </div>
	</div>
	
	<!-- 催缴押金的窗口 -->
	<div id="pay-money-win" class="easyui-window" title="催缴押金" style="width:260px;height:260px"
	    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		<div style="text-align:center;border:px solid red;margin-top: 40px;">
			<form id="paymoney-for" method="post">
			    <p>
					<span>住院号：</span>
					<input id="hospid" name="hospId" class="easyui-textbox" style="width:100px;">
				</p>
				<p style="margin-top: 15px;">
					<span>催缴金额：</span>
					<input name="cashDmoney" class="easyui-textbox" style="width:100px;">
				</p>
				<p  style="margin-top: 15px;">
					<span>办理人：</span>
					<input  name="cashOperatorName" value="${user.userName}" class="easyui-textbox" style="width:100px;">
				</p>
				<p id="paymoney-confrim" style="margin-top: 30px;"><a class="easyui-linkbutton" iconCls="icon-ok" >确定</a></p>
			</form>
		</div>	
	</div>
	
	<!-- 体检退费 -->
	<div id="healthfee-win" class="easyui-window" title="体检退费" style="width:400px;height:300px"
	    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		<div style="text-align:center;border:px solid red;margin-top: 40px;">
			<form id="reutrnhealthmoney-from" method="post">
			    <p>
			    	<a>
					 <span>住院号：</span>
					 <input id="reutrnhospid" name="hospId" class="easyui-textbox" style="width:100px;">
				   </a>
			    	<a style="margin-left:45px;">
					 <span>医疗卡号：</span>
					 <input id="cilicnid" name="clinicId" class="easyui-textbox" style="width:100px;">
				   </a> 
				</p>
				<p style="margin-top:25px;">
				  <a style="margin-left:7px;">
					  <span>姓名：</span>
					  <input id="returnname" name="clinicName" class="easyui-textbox" style="width:100px;">
					
				   </a>
			    	<a style="margin-left:45px;">
					  <span>退费金额：</span>
					  <input id="retrunhealmoney" name="returnhealcashDmoney" class="easyui-textbox" style="width:100px;">
				   </a>	
				</p>
				<p style="margin-top: 30px;winth:100px;">
					<a id="returnfee-confrim" style="winth:100px;" class="easyui-linkbutton" iconCls="icon-ok" >确定</a>
				</p>
			</form>
		</div>	
	</div>
	
	<!-- 调整床位的信息-->
	<div id="feerchangebed-win" class="easyui-window" title="调整床位记录" style="width:650px;height:400px"
	    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		<table id="feerchangebed-table" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:false" style="height:350px;">
		</table>
	</div>
	
	<!-- 交易记录的窗口 -->
	<div id="cashmoney-record-win" class="easyui-window" title="交押金的记录" style="width:530px;height:430px"
	    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		<table id="cashmoney-dg" style="height:380px;" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:true">
		</table>
	</div>
	
	<!-- 所搜住院号的窗口 -->
	<div id="hospid-record-win" class="easyui-window" title="住院的信息(费用结算)" style="width:800px;height:450px"
	    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		<table id="hosprecord-dg" style="height:400px;" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:true">
		</table>
	</div>
	
	<!-- 所搜住院号的窗口 -->
	<div id="hospid-record-win3" class="easyui-window" title="住院的信息(欠费)" style="width:636px;height:450px"
	    data-options="iconCls:'icon-save',closed:true,modal:true,shadow:true,resizable:false,collapsible:false,minimizable:false,maximizable:false">
		<table id="hosprecord-dg3" style="height:400px;" class="easyui-datagrid" data-options="fitColumns:false,singleSelect:true">
		</table>
	</div>
</body>
</html>